﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplicationCS
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            TreeNode newNode;
            TreeNode currentNode;

            newNode =  new TreeNode("test");
            treeView1.Nodes.Add(newNode);
            currentNode = newNode;
            
            newNode = new TreeNode("test1");
            currentNode.Nodes.Add(newNode);
            currentNode = newNode;

            newNode = new TreeNode("test2");
            currentNode.Nodes.Add(newNode);
            currentNode = newNode;

        }

        private async void button1_Click(object sender, EventArgs e)
        {
            var proxy = new ServiceReference1.Service1Client();
            
            progressBar1.Style = ProgressBarStyle.Marquee; // marquee animation starts
            

            ServiceReference1.User user = await proxy.GetUserAsync(new ServiceReference1.User());

            textBox1.Text =  user.Email;

            progressBar1.Style = ProgressBarStyle.Continuous; // marquee animation stops
            
        }
    }
}
